package Demo1

/**
  * Created by lenovo on 2017/7/6.
  * 变长参数
  */
object test2 {

  def main(args: Array[String]) {
    def sum(args:Int*)={
      var result = 0
      for (arg <- args) result += arg
      result
    }

    val a = sum(1,2,3,4)
    print(a)
  }
}
